<!DOCTYPE html>
<html>
<head>
    <title>个人设置</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="description" content="木兰湾管理系统">
    <script type="text/javascript" src="../../static/include/header-css.js"></script>
    <script type="text/javascript">

    </script>
</head>
<body>
<!--编辑页面-->
<div>
    <form id="edit-form">
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd">
                <label class="weui-label">用户名<span class="mulanbay-notNull">*</span></label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" placeholder="" name="username">
            </div>
        </div>
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd">
                <label class="weui-label">昵称</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" placeholder="" name="nickname">
            </div>
        </div>
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd">
                <label class="weui-label">原密码<span class="mulanbay-notNull">*</span></label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="password" placeholder="" name="password">
            </div>
        </div>
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd">
                <label class="weui-label">新密码</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="password" placeholder="" name="newPassword">
            </div>
        </div>
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd">
                <label class="weui-label">二次认证</label>
            </div>
            <div class="weui-cell__bd">
                <select class="weui-input" name="secAuthType">
                    <option value="PASSWORD">密码</option>
                    <option value="SMS">短信</option>
                    <option value="EMAIL">邮件</option>
                    <option value="WECHAT">微信</option>
                </select>
            </div>
        </div>
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd">
                <label class="weui-label">手机</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" placeholder="" name="phone">
            </div>
        </div>
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd">
                <label class="weui-label">邮箱</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" placeholder="" name="email">
            </div>
        </div>
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd">
                <label class="weui-label">生日</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" id='birthday' name="birthday" type="text" value="">
            </div>
        </div>
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd"><label class="weui-label">发送邮件<span class="mulanbay-notNull">*</span></label></div>
            <div class="weui-cell__bd">
                <input class="weui-switch" type="checkbox" name="sendEmail" id="sendEmail" data-on-text="true" data-off-text="false">
            </div>
        </div>
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd"><label class="weui-label">发送微信<span class="mulanbay-notNull">*</span></label></div>
            <div class="weui-cell__bd">
                <input class="weui-switch" type="checkbox" name="sendWxMessage" id="sendWxMessage" data-on-text="true" data-off-text="false">
            </div>
        </div>
        <div class="weui-cell mulanbay_select-before">
            <div class="weui-cell__hd">
                <label class="weui-label">常住城市</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" placeholder="" name="residentCity">
            </div>
        </div>
    </form>
</div>
<br>
<br>
<br>
<a href="javascript:saveData();" class="weui-btn weui-btn_primary weui-footer_fixed-bottom">保存</a>
<script type="text/javascript" src="../../static/include/footer-js.js"></script>
<script>
    $(function() {
        datePicker("birthday");
        getData();
    });
    function getData() {
        var url='/user/getMyInfo';
        doAjax(null,url,'GET',false,function(data){
            $('#edit-form').loadJson(data);
        });
    }
    function saveData() {
        var postData = form2Json("edit-form");
        postData.sendEmail = $("#sendEmail").is(":checked");
        postData.sendWxMessage = $("#sendWxMessage").is(":checked");
        var url='/user/editMyInfo';
        doFormSubmit(postData,url,function(data){
            window.location.href='my.html';
        });
    }

</script>
</body>
</html>